package com.lhx.crud.bean;

import java.util.HashMap;

public class MSG {
    int code;
    String message;
    //哈希类型的方法
    HashMap<String, Object> extend = new HashMap<String, Object>();

    //成功时
    public static MSG success() {
        MSG result = new MSG();
        result.setCode(100); //成功码为100
        result.setMessage("处理成功");
        return result;


    }

    //失败时
    public static MSG fal() {

        MSG result = new MSG();
        result.setCode(200); //成功码为100
        result.setMessage("/处理失败");
        return result;

    }

    public MSG add(String key, Object value) {
         this.getExtend().put(key, value);
        return  this;
    }




    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public HashMap<String, Object> getExtend() {
        return extend;
    }

    public void setExtend(HashMap<String, Object> extend) {
        this.extend = extend;
    }
}
